﻿using Abp.Application.Services;
using RMM.FrameWork;
using RMM.WeChats.Models;
using Senparc.Weixin.MP.AdvancedAPIs.OAuth;
using Swashbuckle.Swagger.Annotations;
using System.Threading.Tasks;
using System.Web.Http;

namespace RMM.WeChats
{
    public interface IWeChatAppService : IApplicationService
    {

        /// <summary>
        /// 微信统一下单
        /// </summary>
        /// <param name="orderCode"></param>
        /// <returns></returns>
        [HttpGet]
        [SwaggerResponse(System.Net.HttpStatusCode.OK, Type = typeof(WechatPayParamModel))]
        Task<ResultDto> JsApiUnifiedOrder(string orderCode);

        /// <summary>
        /// 清理tocken缓存
        /// </summary>
        /// <returns></returns>
        Task ClearTocken();
        /// <summary>
        /// 微信支付回调地址
        /// </summary>
        /// <returns></returns>
        [HiddenApi]
        Task<object> Notify();
        /// <summary>
        /// 获取AccessToken
        /// </summary>
        /// <returns></returns>
        [HiddenApi]
        Task<string> GetAccessTokenAsync();

        /// <summary>
        /// 获取用户信息
        /// </summary>
        /// <param name="openId"></param>
        /// <returns></returns>
        [HiddenApi]
        Task<WechatUserInfo> GetUserInfoAsync(string openId);
    }
}